import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *


testCase="DBshop019_删除属性组"
# 登录后台管理系统,地址是"http://localhost/dbshop/admin",
firefox=openBrowser("http://localhost/dbshop/admin")
firefox.get(urlAdmin)
#调用自定义函数进行后台的登录
DBshopLoginAdmin(firefox)
# 进入销售管理中的发货单,
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性分组')

#定位删除按钮
firefox.find_element_by_xpath("//a[text()='删除']").click()
#c处理js弹窗
firefox.switch_to.alert.accept()


#断言
try:
    firefox.find_element_by_xpath("//td[contains(.,'好好学习')]")
    writeLog("%s 测试失败"%testCase)
except:
    writeLog("%s 测试成功" % testCase)
    getPhoto(firefox)